<include file="Public/head" />
<include file="Public/common_header" />
<div class="mian">
    <include file="Public/sidebar" menu="cxtj.pmbb"  />
    <div class="mianR">
        <h3 class="yonghu">拍单列表</h3>
        <style>.deng-ji{width: 100px}.deng-ji input{width:90px;}</style>
        <div class="shangFrom shangFrom1 clearfix">
            <script src="http://img2.isou365.cn/paimai/cheshan/js/model_select.js" type="text/javascript"></script>
        </div>
        <div class="shangFrom shangFrom1 clearfix">
            <div class="zhuang-tai zhuang-tai1">
                <input type="text" name="starttime" placeholder="请选择开始日期" class="time-text" />
            </div>
            <div class="zhuang-tai zhuang-tai1">
                <input type="text" name="endtime" placeholder="请选择结束日期" class="time-text1" />
            </div>
            <div class="deng-ji">
                <input type="text" name="order_no" placeholder="拍单号" />
            </div>
            <div class="deng-ji">
                <input type="text" name="car_no" placeholder="车源编号" />
            </div>
            <div class="deng-ji">
                <input type="text" name="level" placeholder="车源等级" />
            </div>
            <div class="deng-ji">
                <input type="text" name="contact_person" placeholder="车商姓名" />
            </div>
            <div class="shangSou"><input type="button" id="searchBtn" value="搜索"/></div>
        </div>

        <div class="listBox" id="listBox">

        </div>
        <div class="clear"></div>
    </div>
</div>

<script type="text/javascript">
    document.onkeydown = function(event_e){
           if(window.event) {
               event_e = window.event;
           }

           var int_keycode = event_e.charCode||event_e.keyCode;
           if( int_keycode == '13' ) {
               //your handler function,please.
               $('#searchBtn').click();
               return false;
           }
       }

    ModelSelect.not_allow_model  = true;
    var action = '{$Think.const.ACTION_NAME}'
    var url = '/Stat/get_list';
    function get_list(status) {
        $.get(url, {"status": status}, function (data) {
            $("#listBox").html(data);
        }, "html");
    }
    $('#searchBtn').on('click', function () {
        var starttime = $('input[name=starttime]').val();
        var endtime = $('input[name=endtime]').val();
        var order_no = $('input[name=order_no]').val();
        var car_no = $('input[name=car_no]').val();
        var level = $('input[name=level]').val();
        var contact_person = $('input[name=contact_person]').val();
        var o = ModelSelect.get_vals();
        var mbrand_id = o[0].id;
        var series_id = o[1].id;
        var params = {
            'order_no': order_no,
            'car_no': car_no,
            'mbrand_id': mbrand_id,
            'series_id': series_id,
            'contact_person': contact_person,
            'level': level,
            'starttime': starttime,
            'endtime': endtime
        }
        if (starttime || endtime || order_no || car_no || contact_person || level || mbrand_id || series_id) {
            $(this).val('查询中。。');
            $(this).attr('disabled','disabled');

            $.get(url, params, function (data) {
                $("#listBox").html(data);
                $('#searchBtn').removeAttr('disabled');
                $('#searchBtn').val('搜索');
            }, "html");
        }else{
            shibai_alert('请先选择查询条件',500)
        }
    })
    function get_page(p) {
        $.get(url, {'p': p}, function (data) {
            $("#listBox").html(data);
        }, "html");
    }
</script>
<script>
    $(document).ready(function () {
        $(".time-text").ymdateplugin({
            changeMonth: true,
            changeYear: true
        });
        $(".time-text1").ymdateplugin({
            changeMonth: true,
            changeYear: true
        });

        $(".time-text").click(function () {
            $("#ui-datepicker-div").fadeIn();
//            $("#ui-datepicker-div").append("<input type='button' value='清空' class='moren' onclick='moren(this)'>")
        })

        $(".time-text1").click(function () {
            $("#ui-datepicker-div").fadeIn();
//            $("#ui-datepicker-div").append("<input type='button' value='清空' class='moren' onclick='moren1(this)'>")
        })

    });

    var val_1 = $(".time-text1").attr("placeholder");
    function moren1(ele) {
        $(ele).parent().fadeOut();
        var val_2 = val_1;
        $(".time-text1").val("")
        $(".time-text1").attr({"placeholder": val_2});
    }

    var val1 = $(".time-text").attr("placeholder");
    function moren(ele) {
        $(ele).parent().fadeOut();
        var val2 = val1
        $(".time-text").val("")
        $(".time-text").attr("placeholder", val2);
    }

</script>


<include file="Public/foot" />